Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

XFcFastAllocator< T, aGranularity > Class Template Reference

Fast memory allocation template. More...

Collaboration diagram for XFcFastAllocator< T, aGranularity >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 XFcFastAllocator ()
 Constructor.

 ~XFcFastAllocator ()
 Destructor.

void reset ()
 Resets the allocator (this will not free any memory).

void freeMemory ()
 Frees all allocated memory.

T * alloc ()
 Allocates new object.

T * getCurrent ()
 Returns the pointer to newest object.


Protected Attributes

INT mCurrentItem
XFcLinkedList< T * >::forwardIterator mIterator
XFcLinkedList< T * > mList
 Linked list of arrays.


Detailed Description

template<class T, INT aGranularity>
class XFcFastAllocator< T, aGranularity >

Fast memory allocation template.

Provides a reasonably fast way to allocate objects dynamically.


Constructor & Destructor Documentation

template<class T, INT aGranularity>
XFcFastAllocator< T, aGranularity >::XFcFastAllocator  
 

Constructor.

template<class T, INT aGranularity>
XFcFastAllocator< T, aGranularity >::~XFcFastAllocator  
 

Destructor.


Member Function Documentation

template<class T, INT aGranularity>
T * XFcFastAllocator< T, aGranularity >::alloc  
 

Allocates new object.

template<class T, INT aGranularity>
void XFcFastAllocator< T, aGranularity >::freeMemory  
 

Frees all allocated memory.

template<class T, INT aGranularity>
T * XFcFastAllocator< T, aGranularity >::getCurrent  
 

Returns the pointer to newest object.

template<class T, INT aGranularity>
void XFcFastAllocator< T, aGranularity >::reset  
 

Resets the allocator (this will not free any memory).


Member Data Documentation

template<class T, INT aGranularity>
INT XFcFastAllocator< T, aGranularity >::mCurrentItem [protected]
 

template<class T, INT aGranularity>
XFcLinkedList<T *>::forwardIterator XFcFastAllocator< T, aGranularity >::mIterator [protected]
 

template<class T, INT aGranularity>
XFcLinkedList<T *> XFcFastAllocator< T, aGranularity >::mList [protected]
 

Linked list of arrays.


   
X-Forge Documentation
Confidential
Copyright © 2002-2003 Fathammer
   
Documentation generated
with doxygen
by Dimitri van Heesch